home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Gui4Cli / Docs / Tutorials / Window.gc < prev   
Encoding:
Gui4CLI script  |  1980-01-03  |  2.4 KB  |  90 lines

  1. G4C
  2.  
  3. ; ---- One window has a button which allows you to open another window. 
  4. ;      The second window really is a separate gui in its own right.
  5. ;      It could have been handled in its own separate script, but
  6. ;      here it serves as an example of using the NEWFILE command, 
  7. ;      which allows the script for the second gui to be contained 
  8. ;      within the file you are now reading.
  9. ;      See below under NEWFILE.
  10.  
  11. WinBig 100 -1 200 150 "Window.gc"
  12. WinType 11110001
  13. usetopaz
  14.  
  15. BOX 0 0 0 0 OUT RIDGE
  16.  
  17. xonLoad
  18.  
  19. ; ----- The second button and the instructions are a
  20. ;       distraction until the second window has been
  21. ;       opened, so we hide them till needed. 
  22. setgad Window.gc 1 HIDE
  23. setgad Window.gc 2 HIDE
  24. setgad Window.gc 3 HIDE
  25. setgad Window.gc 4 HIDE
  26. setgad Window.gc 5 HIDE
  27. GuiLoad Work:Tutorial/Window2.gc
  28. GuiOpen Window.gc
  29.  
  30. xonClose
  31. ; ---- Just before we quit the main window, we quit
  32. ;      the second one.
  33. GuiQuit Window2.gc
  34. GuiQuit Window.gc
  35.  
  36. Text 20 25 160 12 "It's hot in here ..." 22 NOBOX
  37. xButton 20 40 160 12 'Open another Window'
  38. GuiOpen Window2.gc
  39.  
  40. ; ---- As soon as the second window has been opened,
  41. ;      the other button and the instructions need to
  42. ;      be seen, and so we show them.
  43. setgad Window.gc 1 SHOW
  44. setgad Window.gc 2 SHOW
  45. setgad Window.gc 3 SHOW
  46. setgad Window.gc 4 SHOW
  47. setgad Window.gc 5 SHOW
  48. Redraw Window.gc
  49.  
  50. xButton 38 120 104 12 'Now close it'
  51. gadid 1
  52. GuiClose Window2.gc
  53. setgad Window.gc 1 HIDE
  54. Redraw Window.gc
  55.  
  56. Text 10 60 100 12 'Have a good look at' 20 NOBOX
  57. gadid 2
  58. Text 10 70 100 12 'the script.  This is' 20 NOBOX
  59. gadid 3
  60. Text 10 80 100 12 'a bit more complicated' 23 NOBOX
  61. gadid 4
  62. Text 10 90 100 12 'than it looks.' 14 NOBOX
  63. gadid 5
  64.  
  65.  
  66. ; ------  THIS IS ANOTHER GUI - the new window, using NEWFILE
  67.  
  68. NEWFILE Window2.gc
  69.  
  70. WinBig 310 -1 200 50 "Window2.gc"  ; Size, position, title
  71. WinType 11110001                   ; System  gadgets, etc
  72. usetopaz
  73.  
  74. ; xonLoad 
  75. ; NOTE - we can not have an xOnLoad command here, since this is a
  76. ; multi-gui file.. *Only* the xOnLoad commands of the 1st gui
  77. ; will be executed! - All other events are allowd though..
  78.  
  79.  
  80. Text 10 20 160 12 "I'm his kid brother..." 24 NOBOX
  81.  
  82. ; ---- No 'onClose' here, because when it is closed we don't
  83. ;      want it to do anything else, like GuiQuit.
  84. ;      We keep it loaded in case we want to reopen it.
  85. ;      Quitting for the second window is handled in the 
  86. ;      'onClose' of the first window.
  87.  
  88.  
  89.  
  90.